﻿@using RoadFlow.Utility;
@using RoadFlow.Model;
@model MailInBox;
<form method="post">
    <style type="text/css" media="print">
        .Noprint {
            display: none;
        }
    </style>
    <div class="toolbar Noprint" style="margin-top:0; border-top:none 0; position:fixed; top:0; left:0; right:0; margin-left:auto; z-index:999; width:100%; margin-right:auto;">
        <a href="javascript:void(0);" onclick="backTo();" title="">
            <i class='fa fa-reply' style='font-size:14px;margin-right:3px;'></i><label>返回</label>
        </a>        <a href="javascript:void(0);" onclick="printwindow();" title="">            <i class='fa fa-print' style='font-size:14px;margin-right:3px;'></i><label>打印</label>        </a>        <span class="toolbarsplit">&nbsp;</span>        <a href="javascript:void(0);" onclick="redirectMail('return');" title="">            <i class='fa fa-envelope' style='font-size:14px;margin-right:3px;'></i><label>回复</label>        </a>        <a href="javascript:void(0);" onclick="redirectMail('redirect');" title="">
            <i class='fa fa-envelope-open' styl");
               viewsMailShowMail.WriteLiteral("e='font-size:14px;margin-right:3px;'></i><label>转发</label>
        </a>        <span class="toolbarsplit">&nbsp;</span>        <a href="javascript:void(0);" onclick="del(0);" title="">
            <i class='fa fa-remove' style='font-size:14px;margin-right:3px;'></i><label>删除</label>
        </a>
        <a href="javascript:void(0);" onclick="del(1);" title="">
            <i class='fa fa-times-circle' style='font-size:14px;margin-right:3px;'></i><label>彻底删除</label>
        </a>
    </div>
    <div style="margin-top:45px;">
        <table cellpadding="0" cellspacing="0" border="0" width="98%;" class="formtable">
            <tr>
                <td style="height:28px; font-weight:bold; font-size:16px; text-align:center;">
                    @Model.Subject
                </td>
            </tr>
            <tr>
                <td style="height:28px; color:#666; text-align:center;">
                    <span style="margin-right:12px;">
                        收件时间：@Model.SendDateTime.ToShortDateTimeString()
                    </span>
                    <span style="margin-right:12px;">
                        发件人： @Model.SendUserId
                    </span>
                </td>
            </tr>
            <tr>                <td style="border-bottom:1px solid #ccc;"></td>            </tr>
            <tr>
                <td style="padding:8px 10px;text-align:left; line-height:21px;">
                    @Html.Raw(ViewData["contents"])
                </td>
            </tr>

            @if (!ViewData["files"].ToString().IsNullOrWhiteSpace())
            {

                <tr>
                    <td style="height:28px;padding:8px 10px;">
                        附件：@Html.Raw(ViewData["files"])
                    </td>
                </tr>
            }

        </table>
        <br />
    </div>
</form>
<script type="text/javascript">
    var mailId = "@ViewData["mailid"]";

    function printwindow() {
        window.print();
    }

    function redirectMail(opation) {
        top.openApp("/RoadFlowCore/Mail/SendMail?@Html.Raw(ViewData["query"])&opation=" + opation + "&mailid=" + mailId, 0, "转发邮件", "tab_mailredirect_" + mailId);
    }

    function backTo() {
        window.location = 'InBox?@Html.Raw(ViewData["query"])';
    }

    function del(status) {
        if (!confirm('您真的要' + (1 == status ? '彻底' : '') + '删除该邮件吗?')) {
            return false;
        }
        $.ajax({
            url: "DeleteMail ? " + "@Html.Raw(ViewData["query"])",
            data: {
                "mailid": mailId,
                "status": status,
                "__RequestVerificationToken": $("input[name = '__RequestVerificationToken']").val()
            }, type: "post",
            success: function (txt) {
            alert(txt);
            if (txt.indexOf('成功') >= 0) {
                window.location = 'InBox?@Html.Raw(ViewData["query"])';
            }
            }
        });
    return true;
    }
</script>